package com.trf.controller;

import com.trf.entity.R;
import com.trf.entity.SmallType;
import com.trf.service.ISmallTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 商品小类的Controller
 *
 * @author 小小唐
 * @Date 2022/6/15-星期三-15:06
 */
@RestController
@RequestMapping("smallType")
public class SmallTypeController {

    @Autowired
    private ISmallTypeService smallTypeService;

    /**
     *
     *
     * @return
     */
    @GetMapping("findSmallType")
    public R findSmallType(){
        List<SmallType> smallTypeList = smallTypeService.list();
        Map<String,Object> map = new HashMap<>();
        map.put("message",smallTypeList);
        return R.ok(map);
    }

}
